<template>
  <a-list size="small">
    <a-list-item v-for='(item,index) in dataObject.items' :key="index"   :border="true">
      <a-list-item-meta :description="item.projectName">
        <a slot="title" style="color: rgba(0, 0, 0, .85)">{{ item.title }}</a>
      </a-list-item-meta>
      <div slot="actions">
        <a @click="handleDetail(item)">详情</a>
      </div>
      <result-list-item-content-v1 :data="item.contents"></result-list-item-content-v1>
      <teaching-common-modal :date="item.record.date" :item-value="item.record.itemValue" :ref="item.record.id"
                             :teacher-id="teacherId" @ok="modalFormOk"></teaching-common-modal>
    </a-list-item>
  </a-list>

</template>

<script>
import ResultListItemContentV1 from '@views/dashboard/gfxy/assessmentResult/commons/ResultListItemContentV1.vue'
import TeachingCommonModal from '@views/gfxy/teaching/modules/TeachingCommonModal'

export default {
  name: "BaseResultListItemV1",
  components: { ResultListItemContentV1,TeachingCommonModal },
  props: {
    dataObject: {
      type: Object,
      default: () => {},
      required: false
    },
    teacherId: {
      type: String,
      required: false
    },
  },
  methods:{
    handleDetail(item){
      console.log("item:",item);
      let id = item.record.id;
      console.log(this.$refs)
      console.log(this.$refs[id])
      this.$refs[id][0].edit(item.record);
      this.$refs[id][0].title="详情";
      this.$refs[id][0].disableSubmit = true;
    },
    modalFormOk(){

    }
  },
  mounted() {
    console.log("BaseResultListItem dataObject : " ,this.dataObject);
  }
}
</script>

<style scoped>

</style>